package cn.loan.spring;

import cn.loan.config.condition.RunConditions;
import com.github.pagehelper.PageInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

/**
 * @Author: 毛苏宇
 * @Description: You can do it!
 * @Date: Create in 14:47 2019/4/25
 */
@Configuration
//扫描注解
@ComponentScan(basePackages = {"cn.loan"})
@Conditional(RunConditions.class)
public class SpringRootConfigure {


    /**
     * 该类可通过通配符得到所有资源
     *
     * @return
     */
    @Bean
    public PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver() {
        return new PathMatchingResourcePatternResolver();
    }

    /**
     * Mybatis插件
     *
     * @return
     */
    @Bean
    public PageInterceptor pageHelper() {
        return new PageInterceptor();
    }


}
